# Maintainer: Hoang Nguyen <folliekazetani@protonmail.com>
pkgname=kubeseal
pkgver=0.24.5
pkgrel=0
pkgdesc="One-way encrypted Secrets tool for Kubernetes"
url="https://sealed-secrets.netlify.app/"
arch="all"
license="Apache-2.0"
makedepends="go"
source="$pkgname-$pkgver.tar.gz::https://github.com/bitnami-labs/sealed-secrets/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/sealed-secrets-$pkgver"

# secfixes:
#   0.19.0-r0:
#     - CVE-2022-32149

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
	go build -v \
		-o bin/$pkgname \
		-ldflags "-X main.VERSION=$pkgver" \
		./cmd/kubeseal
}

check() {
	go test ./...
}

package() {
	install -Dm755 bin/$pkgname -t "$pkgdir"/usr/bin
}

sha512sums="
e0a552f99a866af3b3304182bbdd824a6e7490c6410e3e4b29ffd2ec0e6e9c1f4d7f30a9499ac8b20c3e0313b6bf5e1e26aa14fd67c5725df8eeaf36299e308a  kubeseal-0.24.5.tar.gz
"
